home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 24 / AACD 24.iso / AACD / Online / Epic4 / share / epic / help / 6_functions / rand < prev    next >
Text File  |  2001-03-21  |  978b  |  29 lines

  1. Synopsis:
  2.    $rand(<maximum>)
  3.  
  4. Technical:
  5.    This function generates a pseudo-random number that no larger than the
  6.    given maximum.  The $srand() function should be used first to reduce
  7.    the predictability of the function.  If maximum is less than 1, the
  8.    host's MAX_INT is used (the largest unsigned int it can handle); this
  9.    maximum depends on the operating system and hardware platform of the
  10.    host.
  11.  
  12. Practical:
  13.    Random numbers have a seemingly endless list of possible uses.  Common
  14.    ones for ircII and EPIC include picking some random, automated signoff
  15.    message, connecting to a random server, etc.  Used with $crypt(),
  16.    it can also be used to do some simple encryption.
  17.  
  18. Returns:
  19.    random integer of range 0..maximum
  20.  
  21. Examples:
  22.    $rand(50)             returns a random number no larger than 50
  23.    $rand(-1)             returns a random number no larger than MAX_INT
  24.    $rand()               returns nothing
  25.  
  26. See Also:
  27.    srand(6)
  28.  
  29.